#include <stdio.h>

int main() {
    char c;
    int length = 0;
    int has_word = 0;

    while ((c = getchar()) != '\n' && c != EOF) {
        if (c != ' ') {
            length++;
        } else {
            if (length > 0) {
                printf("%d ", length);
                has_word = 1;
                length = 0;
            }
        }
    }

    if (length > 0) {
        printf("%d ", length);
        has_word = 1;
    }
    // else {
    //     printf("0 ");
    // }


    return 0;
}